package cn.theten52.demo.patterns.design.creation.singleton;

import java.util.UUID;

/**
 * 枚举型单例模式
 *
 * @author wangjin
 * @date 2020/12/25
 */
public enum EnumSingletonFixture {

    INSTANCE;

    private String id = UUID.randomUUID().toString();
    private int counter;

    public String getId() {
        return this.id;
    }

    public void increment() {
        counter++;
    }

    public int getValue() {
        return counter;
    }
}
